package com.android.panballgame;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.Intent;

import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageButton;

public class PBLevel extends Activity{
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	requestWindowFeature(Window.FEATURE_NO_TITLE);
	getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
	setContentView(R.layout.level);

	getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);// 화면 꺼짐 방지
	
	ImageButton level1 = (ImageButton) findViewById(R.id.btnlevel1);
	ImageButton level2 = (ImageButton) findViewById(R.id.btnlevel2);
	ImageButton level3 = (ImageButton) findViewById(R.id.btnlevel3);

	level1.getBackground().setAlpha(PBEngine.MENU_BUTTON_ALPHA);
	level1.setHapticFeedbackEnabled(PBEngine.HAPTIC_BUTTON_FEEDBACK);

	level2.getBackground().setAlpha(PBEngine.MENU_BUTTON_ALPHA);
	level2.setHapticFeedbackEnabled(PBEngine.HAPTIC_BUTTON_FEEDBACK);

	level3.getBackground().setAlpha(PBEngine.MENU_BUTTON_ALPHA);
	level3.setHapticFeedbackEnabled(PBEngine.HAPTIC_BUTTON_FEEDBACK);

	level1.setOnClickListener(new OnClickListener() {// level1 버튼
		public void onClick(View v) {
			// 게임 시작!
			PBEngine.level = 1;
			Intent game1 = new Intent(getApplicationContext(), PBGame.class);
			PBLevel.this.startActivity(game1);
		}
	});
    level2.setOnClickListener(new OnClickListener() {// level2버튼
		public void onClick(View v) {
			// 게임 시작!
			PBEngine.level = 2;
			Intent game2 = new Intent(getApplicationContext(), PBGame.class);
			PBLevel.this.startActivity(game2);
		}
	});

	level3.setOnClickListener(new OnClickListener() {// level3 버튼
		public void onClick(View v) {
			// 게임 시작!
			PBEngine.level = 3;
			Intent game3 = new Intent(getApplicationContext(), PBGame.class);
			PBLevel.this.startActivity(game3);
		}
		});	
	}
}
